/* @(#)UserBusinessImpl.java v${project.version} 2011-6-16 下午04:03:11 
 * 
 * ${project.copyright.info}
 * ${project.copyright}
 * ==============================================================================================================*/
package net.lysa.ooo.business.impl;

import java.util.List;

import javax.inject.Inject;

import net.lysa.ooo.business.UserBusiness;
import net.lysa.ooo.dao.UserDAO;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import domain.Question;
import domain.User;

/**
 * <p>Class description goes here.</p>
 * 
 * @see    java.lang.Object
 * @author caochuan@guahaoe.com
 */
@Service
@Transactional(readOnly = true)
public class UserBusinessImpl implements UserBusiness {
	
	@Transactional
	public void signUp(User user) {
		userDAO.save(user);
	}
	
	@Transactional
	public void createQuestion(Question question){
		userDAO.saveQuestion(question);
	}
	
	public List<User> showUsers(){
		return userDAO.findAll();
	}
	
	public User getUser(String id){
		return userDAO.get(id);
	}
	
	@Transactional
	public void removeUser(String id){
		userDAO.delete(id);
	}
	
	@Inject
	private UserDAO userDAO;

}
